<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap.min.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap-responsive.min.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/uniform.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-style2.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-media.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/font-awesome/css/font-awesome.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/changyun.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<style>
		.table th,.table td{line-height: 20px;text-align: center;border-top: 1px solid #ddd;padding:5px 0 5px 10px;vertical-align: middle;}
	</style>
</head>
<body>
<div id="content">
  <include file="Public/maintop" />
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-box">
			<div class="cyz-m-tab">
				<ul class="cyz-m-tab-title">
					<li class="cyz-m-this" href="javascript:void(0);">广告管理</li>
				</ul>
			</div>
			<div class="widget-content" style="padding:5px;border:0px;">
				<div class="fl table-button">
					<a href="{#:U('add')}" class="btn btn-success"><i class="icon-plus"></i> 新增</a>
				</div>
				<div style="clear: both;"></div>
			</div>

          <div class="widget-content" style="padding:5px;">
            <table class="table table-bordered table-striped with-check">
              <thead>
                <tr>
				  <th style="width:80px;">ID</th>
					<th>广告位置</th>
				  <th class="">广告图</th>
<!--				  <th class="">名称</th>-->
					<th class="">链接地址</th>
				  <th class="">排序</th>
				  <th class="">显示</th>
				  <th class="">操作</th>
                </tr>
              </thead>
              <tbody>
			  <notempty name="list">
			  <volist name="list" id="admin">
				  <form method="post" action="{#:U('index_edit')}" id="form_i_{#$admin.id}">
                <tr>
				  <td>{#$admin.id}</td>
					<td>{#$admin.cate_name}</td>
				  <td><img src="{#$admin.cover}" width="50" height="50" /></td>
<!--                  <td>{#$admin.title}</td>-->
					<td><input type="text" name="url" value="{#$admin.url}" style="width: 180px;" /></td>
					<td><input type="text" name="is_order" value="{#$admin.is_order}" style="width: 50px;" /></td>
                  <td>
					<eq name="admin.is_show" value="1">
					<a href="{#:U('CmsAd/changeStatus?c_field=is_show&c_value=0&id='.$admin['id'])}" class="btn btn-mini btn-success">显示</a>
					<else/>
					<a href="{#:U('CmsAd/changeStatus?c_field=is_show&c_value=1&id='.$admin['id'])}" class="btn btn-mini btn-danger">隐藏</a>
					</eq>
				  </td>
				  <td style="width:220px;">
					  <input type="hidden" name="id" value="{#$admin.id}" />
					  <button type="submit" class="btn btn-mini btn-warning"><i class="icon-refresh"></i> 更新</button>
					<a title="编辑" href="{#:U('edit?id='.$admin['id'])}" class="btn btn-mini btn-success"><i class="icon-pencil"></i> 编辑</a>
					<a title="删除" href="javascript:void(0);" onclick="dodel('{#:U('CmsAd/del?id='.$admin['id'])}')" class="btn btn-mini btn-danger"><i class="icon-remove"></i> 删除</a>
					</td>
                </tr>
				  </form>
				</volist>
				<else/>
				<td colspan="9" class="text-center"> 暂时还没有广告 </td>
				</notempty>
              </tbody>
            </table>
			<div id="hongxin_page_view">{#$page_show}</div>
          </div>
        </div>
	  </div>
    </div>
  </div>
</div>

<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.ui.custom.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.uniform.js"></script>
<script src="__JS__/select2.min.js"></script>
<script src="__JS__/matrix.js"></script>
<script src="__JS__/matrix.tables.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
function dodel(jump_url){
	layer.confirm('确定要删除吗', {
		title:'提示',
		icon: 0,
		btn: ['确定','取消'] //按钮
	}, function(e){
		window.location.href = jump_url;
		layer.close(e);
	}, function(e){
		layer.close(e);
	});
}
function edit_access(e){
	layer.open({
		type : 2,
		offset: '100px',
		title : '授权操作',
		area : ['600px', '300px'],
		content:$(e).attr("data_url"),
		success: function(layero, index){
			//layer.iframeAuto(index);
		}
	});
}
</script>
</body>
</html>
